﻿<phone:PhoneApplicationPage xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device" xmlns:Globalization="clr-namespace:System.Globalization;assembly=mscorlib"  
    x:Class="PNut_Project_Lin.MapPage" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <phone:PhoneApplicationPage.Resources>


        <Style TargetType="my:Pushpin" x:Key="PushpinStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Canvas Height="0"
                            RenderTransformOrigin="0.5,0.5"
                            Width="0">
                            <Canvas RenderTransformOrigin="0.5,0.5"
                                Height="1"
                                Width="1">
                                <Path Data="M22.5,1 C34.374123,1 44,10.625878 44,22.5 C44,31.034525 39.027256,38.407604 31.821138,41.879868 L31.359026,42.095631 L22.702744,60.864998 L13.900847,42.209641 L13.651964,42.100761 C6.1912994,38.727623 0.99999976,31.220058 1,22.5 C0.99999976,10.625878 10.625878,1 22.5,1 z"
                                  Fill="#FFF2E8E2"
                                  Height="61.865"
                                  Stretch="Fill"
                                  Stroke="Black"
                                  StrokeThickness="2"
                                  StrokeLineJoin="Miter"
                                  UseLayoutRounding="False"
                                  Width="45"
                                  RenderTransformOrigin="0.5,0.5"
                                  Canvas.Left="-2.703"
                                  Canvas.Top="-7.187" >
                                    <Path.RenderTransform>
                                        <CompositeTransform TranslateX="-20"
                                                        TranslateY="-55"/>
                                    </Path.RenderTransform>
                                </Path>
                                <Path Data="M35,17.5 C35,27.164984 27.164984,35 17.5,35 C7.8350167,35 0,27.164984 0,17.5 C0,7.8350167 7.8350167,0 17.5,0 C27.164984,0 35,7.8350167 35,17.5 z"
                                  Fill="Tomato"
                                  HorizontalAlignment="Left"
                                  Height="35"
                                  Stretch="Fill"
                                  StrokeThickness="2"
                                  VerticalAlignment="Top"
                                  RenderTransformOrigin="0.5,0.5"
                                  Width="35"
                                  UseLayoutRounding="False"
                                  Canvas.Top="-7.4"
                                  Canvas.Left="-2.888" >
                                    <Path.RenderTransform>
                                        <CompositeTransform TranslateX="-15"
                                                        TranslateY="-50"/>
                                    </Path.RenderTransform>
                                </Path>
                            </Canvas>
                            <ContentPresenter Width="35"
                                          Height="35"
                                          RenderTransformOrigin="0.5,0.5"
                                          Canvas.Top="-3.5">
                                <ContentPresenter.RenderTransform>
                                    <CompositeTransform TranslateX="-18"
                                                    TranslateY="-54"/>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                        </Canvas>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="Black" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="18" />
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <!--Panorama-based applications should not show an ApplicationBar-->

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>


    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="False" IsMenuEnabled="True" Mode="Minimized" Opacity="1.0" >

            <shell:ApplicationBarIconButton x:Name="mode" IconUri="picture/Mode.png" Text="Mode" Click="mode_Click"  />
            <shell:ApplicationBarIconButton x:Name="me_a" IconUri="picture/PushpinLocation.png" Text="Me" Click="me_a_Click"  />


        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <controls:Panorama x:Name="Pano">
            <controls:Panorama.Background>
                <ImageBrush Stretch="Fill" ImageSource="/picture/carpark.PNG" Opacity="0.4"/>
            </controls:Panorama.Background>

            <!--Panorama item one-->
            <controls:PanoramaItem >
                <ScrollViewer x:Name="sc_main">
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Image Width="60" Margin="5,10,5,5" Source="/PNut_Project_Lin;component/picture/map_app.png" />
                            <TextBlock Text="ค้นหาอู่ซ่อม" FontSize="64" />
                        </StackPanel>
                        <my:Map ZoomBarVisibility="Visible" x:Name="Map_Ob" Center="16.474609,102.835413" ZoomLevel="10"  Hold="Map_Ob_Hold"
                    		CredentialsProvider="AlNEsxFmSkoJlPNgtBwostiX9Gfl6SXpmiJMDdVcIs1Jvbnf9ewbP7IrpTk62ggu" Height="576"  Mode="Aerial" LogoVisibility="Collapsed" AnimationLevel="Full" >
                           
                        </my:Map>
                        <StackPanel x:Name="sumonTa" Visibility="Collapsed" Orientation="Horizontal" Margin="0,5,0,5" >
                            
                            <StackPanel.Background>
                                <ImageBrush Stretch="Fill" ImageSource="/picture/gray.jpg" Opacity="0.35"/>
                            </StackPanel.Background>
                            <StackPanel>
                                <TextBlock FontWeight="Bold">
                                	<Run Text="ชื่อ :"/>
                                </TextBlock>
                                <TextBlock FontWeight="Bold">
                                	<Run Text="ที่อยู่ :"/>
                                </TextBlock>
                                <TextBlock FontWeight="Bold">
                                	<Run Text="เบอร์โทร :"/>
                                </TextBlock>
                                <TextBlock FontWeight="Bold">
                                	<Run Text="ระยะทาง :"/>
                                </TextBlock>
                            </StackPanel>
                            <StackPanel Width="330" >
                                <TextBlock Width="250" x:Name="Name_lt"/>
                                <TextBlock Width="250"  x:Name="Add_lt"/>
                                <TextBlock Width="250"  x:Name="Tel_lt"/>
                                <TextBlock Width="250"  x:Name="Dis_lt"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel x:Name="st_CN" Visibility="Collapsed" Orientation="Horizontal" HorizontalAlignment="Center"  Margin="5,10,5,5">
                            <Image  Height="50" x:Name="Call_im" Source="/picture/btn_call.png" MouseLeftButtonDown="Call_im_MouseLeftButtonDown" />
                            <Image  Height="48" x:Name="Navi_im" Source="picture/direction_to.png" MouseLeftButtonDown="Navi_im_MouseLeftButtonDown"  />
                        </StackPanel>
                    </StackPanel>
                </ScrollViewer>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem >
                <StackPanel>
                    <TextBlock Text="รายชื่ออู่" FontSize="64" />
                    <ListBox x:Name="ListBox" Height="736"  ItemsSource="{Binding}" SelectionChanged="ListBox_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock Margin="15,0,0,0" Text="{Binding Name}" FontFamily="/PNut_Project_Lin;component/Fonts/Fonts.zip#TH Sarabun New" FontSize="46" VerticalAlignment="Center" TextWrapping="Wrap" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>


</phone:PhoneApplicationPage>